﻿
Imports System.IO
Imports std
Imports xmlctrl
Imports rssparserN

Public Class rssparserpool
    Inherits pool(Of pair(Of rssparser, StreamReader))

    Protected Overrides Function create() As pair(Of rssparser, StreamReader)
        Dim rtn As pair(Of rssparser, StreamReader) = Nothing
        rtn = make_pair(Of rssparser, StreamReader)(New rssparser(), Nothing)
        rtn.first.output = New MemoryStream()
        rtn.second = New StreamReader(rtn.first.output)
        Return rtn
    End Function

    Public Sub New()
        MyBase.New()
    End Sub

    Public Sub New(ByVal buffcount As Int64)
        MyBase.New(buffcount)
    End Sub

    Protected Overrides Sub Finalize()
        Dim i As Int32
        For i = 0 To pool.Length() - 1
            If Not pool(i) Is Nothing Then
                closestream(pool(i).second)
                pool(i).first.clear()
            End If
        Next
        MyBase.Finalize()
    End Sub
End Class
